package com.arpa.wms.mapper;

import com.arpa.wms.domain.dto.GoodsDTO;
import com.arpa.wms.domain.entity.Goods;
import com.arpa.wms.domain.vo.GoodsVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author: Allen chen
 * @Date 2020/8/12
 * @Description:
 */
public interface GoodsMapper extends BaseMapper<Goods> {

    GoodsVO queryListSum(GoodsDTO unitDTO);

    List<GoodsVO> queryList(GoodsDTO unitDTO);

    List<GoodsVO> queryByCondition(GoodsDTO unitDTO);

    List<GoodsVO> queryByTypeCode(List<String> list);

    List<GoodsVO> queryByBrandCode(@Param("list")List<String> list,@Param("partyGroupCode") String partyGroupCode);

    List<GoodsVO> queryByCodes(@Param("list") List<String> list,@Param("partyGroupCode") String partyGroupCode);

    List<GoodsVO> queryByUnitCode(List<String> list);

    List<GoodsVO> queryByBatchRuleCodes(List<String> list);

    List<GoodsVO> query(GoodsDTO unitDTO);

    int batchDelete(List<String> codes);

    List<Map<String,Object>>queryQuantity(List<String> list);

    /**
     * 执行原生sql
     * @param sql
     * @return
     */
    int execSql(@Param("sql") String sql);

    /**
     * 模糊查询货主商品
     * @param keywords 查询关键字
     * @param shipmentCode 货主标识
     * @return 商品信息 code、名称
     */
    List<String> searchGoodsCode(@Param("keywords")String keywords,@Param("shipmentCode") String shipmentCode,@Param("groupCode")String groupCode);

    /**
     * 模糊查询商品
     * @param goodCode 商品编码
     * @param goodsName 商品名称
     */
    List<String> searchByGoodCodeAndName(@Param("goodCode") String goodCode,@Param("goodsName") String goodsName, @Param("groupCode")String groupCode,@Param("shipmentCodes") List<String> shipmentCodes);
}
